<?php
//dezend by http://www.yunlu99.com/ QQ:270656184
defined('BASEPATH') || exit('No direct script access allowed');

if (!function_exists('num')) {
	function num($num, $n = 6)
	{
		if ($num < 0) {
			return 0;
		}

		if ($n < 0) {
			$n = 0;
		}

		return floatval(sprintf('%.' . $n . 'f ', $num));
	}
}

if (!function_exists('num_s')) {
	function num_s($num, $n = 6)
	{
		if ($num < 0) {
			return 0;
		}

		if ($n < 0) {
			$n = 0;
		}

		return sprintf('%.' . $n . 'f ', $num);
	}
}

?>
